home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINWORDS / SPELL10.ZIP / FRMCHK.FO_ / FRMCHK.FO
Text File  |  1993-12-04  |  5KB  |  176 lines

  1. VERSION 2.00
  2. Begin Form FrmChk 
  3.    Caption         =   "TLC Spelling Checker"
  4.    ClientHeight    =   2580
  5.    ClientLeft      =   1380
  6.    ClientTop       =   2436
  7.    ClientWidth     =   6324
  8.    Height          =   3000
  9.    Left            =   1332
  10.    LinkTopic       =   "Form2"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   2580
  14.    ScaleWidth      =   6324
  15.    Top             =   2064
  16.    Width           =   6420
  17.    Begin Frame Frame1 
  18.       Height          =   2604
  19.       Left            =   0
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   6348
  23.       Begin Frame Frame2 
  24.          Caption         =   "Command Buttons"
  25.          Height          =   1992
  26.          Left            =   3168
  27.          TabIndex        =   4
  28.          Top             =   360
  29.          Width           =   2928
  30.          Begin CommandButton Cmd 
  31.             Caption         =   "Delete"
  32.             Height          =   336
  33.             Index           =   4
  34.             Left            =   2124
  35.             TabIndex        =   11
  36.             Top             =   1620
  37.             Width           =   732
  38.          End
  39.          Begin CheckBox CkHilight 
  40.             Caption         =   "Highlight"
  41.             Height          =   192
  42.             Left            =   1476
  43.             TabIndex        =   10
  44.             Top             =   684
  45.             Value           =   1  'Checked
  46.             Width           =   1092
  47.          End
  48.          Begin CommandButton Cmd 
  49.             Caption         =   "&Quit"
  50.             Height          =   336
  51.             Index           =   3
  52.             Left            =   1440
  53.             TabIndex        =   9
  54.             Top             =   1008
  55.             Width           =   732
  56.          End
  57.          Begin CheckBox CkSuggest 
  58.             Caption         =   "Suggest"
  59.             Height          =   228
  60.             Left            =   1440
  61.             TabIndex        =   6
  62.             Top             =   324
  63.             Value           =   1  'Checked
  64.             Width           =   1092
  65.          End
  66.          Begin CommandButton Cmd 
  67.             Caption         =   "&Change"
  68.             Height          =   336
  69.             Index           =   2
  70.             Left            =   252
  71.             TabIndex        =   8
  72.             Top             =   1332
  73.             Width           =   840
  74.          End
  75.          Begin CommandButton Cmd 
  76.             Caption         =   "&Next"
  77.             Height          =   336
  78.             Index           =   1
  79.             Left            =   252
  80.             TabIndex        =   7
  81.             Top             =   792
  82.             Width           =   840
  83.          End
  84.          Begin CommandButton Cmd 
  85.             Caption         =   "&Add"
  86.             Height          =   336
  87.             Index           =   0
  88.             Left            =   252
  89.             TabIndex        =   5
  90.             Top             =   324
  91.             Width           =   840
  92.          End
  93.       End
  94.       Begin TextBox TxtNew 
  95.          Height          =   300
  96.          Left            =   180
  97.          TabIndex        =   3
  98.          Text            =   "TxtNex"
  99.          Top             =   576
  100.          Width           =   2424
  101.       End
  102.       Begin ListBox LstSuggest 
  103.          Height          =   1368
  104.          Left            =   396
  105.          TabIndex        =   1
  106.          Top             =   972
  107.          Width           =   1884
  108.       End
  109.       Begin Label LblHis 
  110.          Caption         =   "LblHis"
  111.          Height          =   264
  112.          Left            =   216
  113.          TabIndex        =   2
  114.          Top             =   252
  115.          Width           =   2280
  116.       End
  117.    End
  118. End
  119. Option Explicit
  120.  
  121. Sub CkSuggest_Click ()
  122.    If CkSuggest = 0 Then
  123.       LstSuggest.AddItem "(No Suggestions)"
  124.    Else
  125.       LstSuggest.Clear
  126.    End If
  127. End Sub
  128.  
  129. Sub Cmd_Click (index As Integer)
  130.   Dim i As Integer
  131.    Select Case index
  132.      Case 0: i = WFind(LblHis, 1, LexPath + "English.Lex")
  133.              LstSuggest.Clear
  134.              While ChkWord()
  135.              Wend
  136.      Case 1: LstSuggest.Clear
  137.              While ChkWord()
  138.              Wend
  139.      Case 2: i = Len(TxtNew)
  140.              FrmDoc!Text1 = Left(FrmDoc!Text1, WordStart - 1) + TxtNew + Mid(FrmDoc!Text1, WordEnd)
  141.              LastCk = WordStart + i
  142.              LstSuggest.Clear
  143.              While ChkWord()
  144.              Wend
  145.      Case 3: Unload Me
  146.              Exit Sub
  147.      Case 4: i = DelWord(TxtNew, LexPath + "English.Lex")
  148.              While ChkWord()
  149.              Wend
  150.  
  151.    End Select
  152.   
  153. End Sub
  154.  
  155. Sub Form_Load ()
  156. ' To use in a different program:
  157. ' before calling set LastCk=0 LexPath=path to english.lex+"\"
  158. ' Edit FrmDoc!Text1 to the name of the form and text box that you want to spell check
  159. ' Edit FrmAbout!CmnDialog in GetFileName to the name of your common dialog control
  160. ' Remove Sub Main  from SpellM1.Bas
  161. ' enclude SpellM1.Bas and FrmChk.Frm in you program
  162.    While ChkWord()
  163.    Wend
  164. End Sub
  165.  
  166. Sub Form_Unload (Cancel As Integer)
  167.        WordStart = 0
  168.        WordEnd = 0
  169.        LastCk = 0
  170. End Sub
  171.  
  172. Sub LstSuggest_DblClick ()
  173.    TxtNew = LstSuggest.List(LstSuggest.ListIndex)
  174. End Sub
  175.  
  176.